package com.trytry.dao;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.stereotype.Repository;

import com.trytry.entity.Article;
import com.trytry.entity.Page;
import com.trytry.entity.User;
@Repository
public class UserDaoImpl extends CommonDaoImpl implements UserDao  {

	
	@Override
	public User login(User u) {
		Query q=this.getCurrentSession().createQuery("from User");
		List<User> ulist=q.list();
		return ulist.get(4);
	}

	@Override
	public List<User> getall() {
		Query q= this.getCurrentSession().createQuery("from User");
		List<User> ulist=q.list();
		return ulist;
	}

	@Override
	public Page<Article> getArticles(int start, int limit, int currentpage) {
		return null;
	}
}
